//
//  CHBubbleMessageCell.h
//  ChildHoodStemp
//
//  Created by lixu on 13-10-5.
//
//

#import <UIKit/UIKit.h>
#import "CHBubbleView.h"

@class ChildHoodMessage;

typedef enum {
    CHAvatarStyleCircle = 0,
    CHAvatarStyleSquare,
} CHAvatarStyle;

#define TIMESTAMP_LABEL_HEIGHT 15.0f

#define SENDERNAME_LABEL_HEIGHT 20.0f

#define SENDERTITLE_LABEL_HEIGHT 15.0f

#define SendAlert_Label_Height  20.0f

@protocol CHBubbleMessageCellDelegate;

@interface CHBubbleMessageCell : UITableViewCell
{
    NSString *_largePicURI;
    BOOL     _isNotice;
  

}
//@property (assign, nonatomic) int64_t messageDBID;


@property (assign, nonatomic) BOOL  isNotice;
@property (strong, nonatomic) UIButton *avatarView;
@property (copy, nonatomic) NSString *largePicURI;
@property (retain, nonatomic) NSIndexPath *cellIndexPath;
@property (assign, nonatomic)NSArray*   messageList;
@property (assign,nonatomic)id<CHBubbleMessageCellDelegate> delegate;
@property (strong, nonatomic) CHBubbleView *bubbleView;
@property (nonatomic, weak) UIProgressView *progressView;
@property (nonatomic, strong) ChildHoodMessage *chidMessage;

#pragma mark - Initialization
- (id)initWithBubbleType:(CHBubbleMessageType)type
             bubbleStyle:(CHBubbleStyle)bubbleStyle
             avatarStyle:(CHAvatarStyle)avatarStyle
            hasTimestamp:(BOOL)hasTimestamp
                isNotice:(BOOL)flag isHasSenderName:(BOOL)hasSenderName
         reuseIdentifier:(NSString *)reuseIdentifier ismap:(BOOL)ismap;

#pragma mark - Message cell
- (void)setPicture:(NSString *)uri nextURI:(NSString *)nextUri withStatus:(int32_t)status  andProcess:(NSInteger)process fileName:(NSString *)fileName fileId:(NSString *)fileId chatType:(NSString *)chatType childMessage:(ChildHoodMessage *)message;

- (void)setVideo:(NSString*)url withStatus:(int32_t)status andProcess:(NSInteger)process fileName:(NSString*)fileName fileId:(NSString*)fileId chatType:(NSString*)chatType chileMessage:(ChildHoodMessage*)message;

- (void)setFileWithStatus:(int32_t)status  andProcess:(NSInteger)process fileName:(NSString *)fileName fileId:(NSString *)fileId chatType:(NSString *)chatType childMessage:(ChildHoodMessage *)message;
- (void)setRedPacketInfo:(NSString*)info withStatus:(int32_t)status;
- (void)setMessage:(NSString *)msg withStatus:(int32_t)status;
- (void)setVoice:(NSString *)uri totalTime:(CGFloat)time isRead:(MessageSoundPlayStatus)flag withStatus:(int32_t)status  andProcess:(NSInteger)process fileName:(NSString *)fileName fileId:(NSString *)fileId chatType:(NSString *)chatType childMessage:(ChildHoodMessage *)message;


- (void)setTimestamp:(NSDate *)date;
- (void)setAvatarImage:(NSString *)uri;
- (void)setName:(NSString *)senderName;
- (void)setTitle:(NSString *)senderTitle;
- (void)setMemoryID:(uint32_t)memoryID;
- (void)setMessageStatus:(MessageSendType)type;
- (void)setIndexPathForVoice;
- (void)hideRedpot;
+ (CGFloat)neededHeightForText:(NSString *)bubbleViewText
                     timestamp:(BOOL)hasTimestamp isHasSenderName:(BOOL)hasSenderName;
@end
@protocol CHBubbleMessageCellDelegate <NSObject>

- (void)touchCellDeleteWithCell:(CHBubbleMessageCell *)messageCell;
- (void)touchCellCopyDeleteWithCell:(CHBubbleMessageCell *)messageCell;
- (void)touchCellReSenderWithCell:(CHBubbleMessageCell *)messageCell;
- (void)menuControllerDidForWardWithString:(NSString*)str;
- (void)menuControllerDidDeleteWithIndexpath:(NSIndexPath *)indexPath;
- (void)jumpToDetailInfoViewWithIndexPath:(NSIndexPath *)indexPath;
- (void)jumptoDownLoadFileWithIndexPath:(NSIndexPath *)indexPath;
- (void)jumptoMapWithIndexPath:(NSIndexPath *)indexPath;
- (void)openFullScreenPlayVido:(NSIndexPath*)indexPath;
- (void)openredPacketWithIndexPath:(NSIndexPath*)indexPath;
@end
